package com.xiaoxi.open.common.exception;


import com.xiaoxi.open.common.enumeration.BaseStatusType;
import lombok.Data;

/**
 * 异常处理类
 *
 * @author xiaoxi
 * @version 1.0
 * @date 2022/5/16 14:41
 */
@Data
public class BaseException extends RuntimeException {

    private String code;

    public BaseException(String code, String message) {
        super(message);
        this.code = code;
    }

    public BaseException(BaseStatusType baseStatusType) {
        super(baseStatusType.getMsg());
        this.code = baseStatusType.getCode();
    }

}
